package com.yylending.las.common.location.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by laixj on 2016/11/16.
 * Copyright © 2016 www.yyfax.com. All Rights Reserved.
 */
public class Location implements Parcelable{
	public double latitude;
	public double longitude;
	public Address address;
	public long lastTime;

	public Location() {
	}

	public Location(double latitude, double longitude) {
		this.latitude = latitude;
		this.longitude = longitude;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeDouble(this.latitude);
		dest.writeDouble(this.longitude);
		dest.writeParcelable(this.address, flags);
		dest.writeLong(this.lastTime);
	}

	protected Location(Parcel in) {
		this.latitude = in.readDouble();
		this.longitude = in.readDouble();
		this.address = in.readParcelable(Address.class.getClassLoader());
		this.lastTime = in.readLong();
	}

	public static final Creator<Location> CREATOR = new Creator<Location>() {
		@Override
		public Location createFromParcel(Parcel source) {
			return new Location(source);
		}

		@Override
		public Location[] newArray(int size) {
			return new Location[size];
		}
	};
}
